/**
 */
package fUML.Semantics.Actions.CompleteActions.impl;

import fUML.Semantics.Actions.BasicActions.impl.ActionActivationImpl;

import fUML.Semantics.Actions.CompleteActions.CompleteActionsPackage;
import fUML.Semantics.Actions.CompleteActions.ReduceActionActivation;

import fUML.Semantics.CommonBehaviors.BasicBehaviors.Execution;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Reduce Action Activation</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link fUML.Semantics.Actions.CompleteActions.impl.ReduceActionActivationImpl#getCurrentExecution <em>Current Execution</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class ReduceActionActivationImpl extends ActionActivationImpl implements ReduceActionActivation {
	/**
	 * The cached value of the '{@link #getCurrentExecution() <em>Current Execution</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getCurrentExecution()
	 * @generated
	 * @ordered
	 */
	protected Execution currentExecution;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected ReduceActionActivationImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return CompleteActionsPackage.Literals.REDUCE_ACTION_ACTIVATION;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Execution getCurrentExecution() {
		if (currentExecution != null && currentExecution.eIsProxy()) {
			InternalEObject oldCurrentExecution = (InternalEObject)currentExecution;
			currentExecution = (Execution)eResolveProxy(oldCurrentExecution);
			if (currentExecution != oldCurrentExecution) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, CompleteActionsPackage.REDUCE_ACTION_ACTIVATION__CURRENT_EXECUTION, oldCurrentExecution, currentExecution));
			}
		}
		return currentExecution;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Execution basicGetCurrentExecution() {
		return currentExecution;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setCurrentExecution(Execution newCurrentExecution) {
		Execution oldCurrentExecution = currentExecution;
		currentExecution = newCurrentExecution;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, CompleteActionsPackage.REDUCE_ACTION_ACTIVATION__CURRENT_EXECUTION, oldCurrentExecution, currentExecution));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case CompleteActionsPackage.REDUCE_ACTION_ACTIVATION__CURRENT_EXECUTION:
				if (resolve) return getCurrentExecution();
				return basicGetCurrentExecution();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case CompleteActionsPackage.REDUCE_ACTION_ACTIVATION__CURRENT_EXECUTION:
				setCurrentExecution((Execution)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case CompleteActionsPackage.REDUCE_ACTION_ACTIVATION__CURRENT_EXECUTION:
				setCurrentExecution((Execution)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case CompleteActionsPackage.REDUCE_ACTION_ACTIVATION__CURRENT_EXECUTION:
				return currentExecution != null;
		}
		return super.eIsSet(featureID);
	}

} //ReduceActionActivationImpl
